Research
Security News
Threat Actor Exposes Playbook for Exploiting npm to Build Blockchain-Powered Botnets
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
slab-decomposition
Advanced tools
Given a collection of line segments, constructs a slab decomposition for the purpose of point location queries. This implementation uses a functional red-black tree to store the slabs, requires O(n log(n)) space and answers vertical ray queries in O(log(n)) time.
var makeSlab = require("slab-decomposition")
var slabs = makeSlab([
[[0, 0], [10, 10]],
[[10,10], [20, 0]],
[[5, 5], [20, 0]]
])
for(var i=-10; i<10; ++i) {
console.log(slabs.castUp([i, -1]))
}
npm install slab-decomposition
var slabs = require("slab-decomposition")(segments)
Constructs a slab decomposition from the segments
segments
is a collection of line segments which only overlap at their end pointsReturns A slab decomposition data structure
slabs.castUp(point)
Casts a vertical ray from point
going upward along [0,1]
. Returns the index of the first segment hit.
point
is the base point of the rayReturns The index of the first segment hit by point, otherwise -1 if no segment intersects the ray.
(c) 2014 Mikola Lysenko. MIT License
FAQs
Slab decomposition data structure for 2D vertical ray queries
The npm package slab-decomposition receives a total of 18,385 weekly downloads. As such, slab-decomposition popularity was classified as popular.
We found that slab-decomposition demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
Security News
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Security News
Research
A malicious npm package disguised as a WhatsApp client is exploiting authentication flows with a remote kill switch to exfiltrate data and destroy files.